package com.yuanfeng.service.impl;

import com.yuanfeng.basedata.entiry.KcsjUser;
import com.yuanfeng.basedata.repository.UserRepository;
import com.yuanfeng.service.UserManageService;
import com.yuanfeng.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;
import java.util.Optional;

/**
 * @ClassName UserServiceImpl
 * @Description T0D0
 * @Author yuanfeng
 * @Date 2019/9/6 21:50
 * @Version 1.0
 **/
@Service
@Transactional
public class UserManageServiceImpl implements UserManageService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public KcsjUser addUser(KcsjUser kcsjUser) {
        return userRepository.save(kcsjUser);
    }

    @Override
    public KcsjUser deleteUser(Integer userId) {
        return userRepository.deleteByUserId(userId);
    }
}
